package com.xquant.common.engine.xPP.response;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * @author B946
 * @date 29/09/2020 13:40
 * @description:
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SceneResponse {

    private String term;
    private String strike;
    private String strikePercentage;

    private CalcMarket result;

    public String getTerm() {
        return term;
    }

    public void setTerm(String term) {
        this.term = term;
    }

    public String getStrike() {
        return strike;
    }

    public void setStrike(String strike) {
        this.strike = strike;
    }

    public String getStrikePercentage() {
        return strikePercentage;
    }

    public void setStrikePercentage(String strikePercentage) {
        this.strikePercentage = strikePercentage;
    }

    @JsonIgnore
    public Object getResult() {
        return result;
    }

    public void setResult(CalcMarket result) {
        this.result = result;
    }

    public String getNpv(){
        if(this.result == null || this.result.getContract() == null){
            return null;
        }
        return this.result.getContract().getNpv();
    }
    public String getDelta(){
        if(this.result == null || this.result.getContract() == null){
            return null;
        }
        return this.result.getContract().getDelta();
    }
    public String getGamma(){
        if(this.result == null || this.result.getContract() == null){
            return null;
        }
        return this.result.getContract().getGamma();
    }
    public String getRho(){
        if(this.result == null || this.result.getContract() == null){
            return null;
        }
        return this.result.getContract().getRho();
    }
    public String getTheta(){
        if(this.result == null || this.result.getContract() == null){
            return null;
        }
        return this.result.getContract().getTheta();
    }

}
